
package com.example.demo.listener;

import org.springframework.context.ApplicationEvent;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.EventListener;
import org.springframework.web.context.support.GenericWebApplicationContext;

@Configuration
public class EventConfig {
    @EventListener(classes = ApplicationEvent.class)
    public void listen(ApplicationEvent event) {
        System.out.println("接收到事件：" + event);
    }
}